function xlDangNhap()
{
	var xmlHttp;
	if(window.XMLHttpRequest)
		xmlHttp = new XMLHttpRequest();
	else
		xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");	
		
	var us = document.getElementById("txtUS");
	if(us.value == "")
	{
		alert("Chưa nhập tên đăng nhập");
		us.focus();
		return;
	}
	
	var ps = document.getElementById("txtPS");
	if(ps.value == "")
	{
		alert("Chưa nhập mật khẩu");
		ps.focus();
		return;	
	}
	var para = "us="+us.value+"&ps="+ps.value;
	
	xmlHttp.onreadystatechange = function(){
		if(xmlHttp.readyState == 4 && xmlHttp.status == 200)
			document.getElementById("navDangNhap").innerHTML = xmlHttp.responseText;
	}
	
	xmlHttp.open("post","pages/xlDangNhap.php",true);
	xmlHttp.setRequestHeader("Content-type","application/x-www-form-urlencoded");
	xmlHttp.send(para);
}

function xlDangXuat()
{
	var xmlHttp;
	if(window.XMLHttpRequest)
		xmlHttp = new XMLHttpRequest();
	else
		xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");	
	
	xmlHttp.onreadystatechange = function(){
		if(xmlHttp.readyState == 4 && xmlHttp.status == 200)
			document.getElementById("navDangNhap").innerHTML = xmlHttp.responseText;
	}
	
	xmlHttp.open("get","pages/xlDangXuat.php",true);
	xmlHttp.send();
}